package com.msh.artascope.devcloud.service.service;

import com.msh.artascope.devcloud.client.po.ModuleRunPo;
import com.msh.artascope.devcloud.client.qo.ModuleRunQo;
import com.msh.artascope.devcloud.service.model.query.ModuleRunQueryVo;
import com.msh.artascope.devcloud.service.model.vo.ModuleRunVo;
import com.msh.artascope.devcloud.service.model.vo.PodVo;
import com.msh.artascope.interfaces.ILoginAccount;
import com.msh.frame.client.base.TenantBaseService;
import com.msh.frame.client.common.Result;
import java.util.List;

/**
 * @author shihu
 * @mail m-sh@qq.com
 */
public interface ModuleRunService extends TenantBaseService<ModuleRunPo,ModuleRunQo> {

  List<PodVo> listPod(Long moduleId, Long tenantId);

  String getLogs(Long moduleId, String podName, Integer line, Long tenantId);

  /**
   * 删除旧的启动新的deployment
   *
   * @param buildId
   * @return
   */
  ModuleRunVo start(Long buildId, ILoginAccount loginAccount);


  /**
   * 重启 删除pods
   * @param buildId
   * @return
   */
  ModuleRunVo restart(Long buildId, ILoginAccount loginAccount);

  /**
   * 停止 删除deployment
   * @param buildId
   * @return
   */
  ModuleRunVo stop(Long buildId, ILoginAccount loginAccount);


// ----------前端vo处理-------------------------------------------------------
  /**
   * id查询
   * @param id 主键id
   * @return  查询Vo列表
   */
  ModuleRunVo getVo(Long id, Long tenantId);

  /**
   * 查询
   * @param q 查询QueryVo
   * @return  查询Vo列表
   */
  List<ModuleRunVo> listVo(ModuleRunQueryVo q);

  /**
   * 分页查询
   * @param q 查询QueryVo
   * @return  分页查询Po列表
   */
  Result<List<ModuleRunVo>> pageVo(ModuleRunQueryVo q);


}
